<template>
  <div class="home-nav">
      <el-menu
      :uniqueOpened="true"
      default-active="我创建的团队"
      class="el-menu-vertical-demo"
      @select="handleSelect"
      background-color="#545c64"
      text-color="#fff"
      active-text-color="#ffd04b">
      <el-menu-item index="我创建的团队">
        <i class="el-icon-menu"></i>
        <template #title>我创建的团队</template>
      </el-menu-item>
     
      <el-menu-item index="我加入的团队">
        <i class="el-icon-user-solid"></i>
        <template #title>我加入的团队</template>
      </el-menu-item>
      <el-menu-item index="个人中心">
        <i class="el-icon-user-solid"></i>
        <template #title>个人中心</template>
      </el-menu-item>
    </el-menu>
  </div>
</template>

<script>
import { useRouter } from 'vue-router'
export default {
  setup () {
    const router = useRouter()
    router.push({ name: 'MyTeam' })
    const handleSelect = (key) => {
      if (key === '我创建的团队') router.push({ name: 'MyTeam' })
      if (key === '我加入的团队') router.push({ name: 'FollowTeam' })
      if (key === '个人中心') router.push({name: "My"})
    }
    return {
      handleSelect
    }
  }
}
</script>

<style lang="scss" scoped>
    .home-nav{
        .el-menu-item{
            width: 200px;
        }
    }
</style>
